package com.luxuewen.sxa.controller;

import com.luxuewen.sxa.service.impl.CommonServiceImpl;
import com.luxuewen.sxa.utils.response.ApiResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;


/**
 * @author wen
 */
@Slf4j
@RestController
public class CommonController {
    @Autowired
    private CommonServiceImpl commonService;

    @PostMapping("/common/upload")
    public ApiResponse<String> upload (MultipartFile file) {
        String url = commonService.upload(file);

        return ApiResponse.success(url);
    }
}
